<?php echo $this->render('/public/header');?>
<style>
	[v-cloak]{
		display:none;
	}
</style>
<div id="main" class="col-xs-12">
	<a href="javascript:window.history.go(-1)" class="layui-btn layui-btn-normal">返回</a>
	<div class="alert alert-success" style="float:right">净额统计:{{clean_fee.toFixed(2)}}</div>
	<div class="alert alert-info" style="float:right">收入统计:{{all_income.toFixed(2)}}</div>
	<br/>
	<br/>
	<table class="table	table-borderd">
		<thead>
			<tr>
				<th style="width:50px">id</th>
				<th style="width:80px">日期</th>
				<th style="width:100px">invoice</th>
				<th>交易方对手账号</th>
				<th style="width:50px">国家</th>
				<th>客户名称</th>
				<th>收入</th>
				<th>支出</th>
				<th>费用</th>
				<th>净额</th>
				<th>备注</th>
			</tr>
		</thead>
		<tbody  v-cloak>
			<tr v-for="v in list">
				<td>{{v.id}}</td>
				<td>{{v.date}}</td>
				<td>{{v.invocie_num}}</td>
				<td>{{v.name}}</td>
				<td>{{v.country}}</td>
				<td>{{v.customer_name}}</td>
				<td>{{v.in_come}}</td>
				<td>{{v.total_fee}}</td>
				<td>{{v.fee}}</td>
				<td>{{(parseFloat(v.in_come)+parseFloat(v.total_fee)+parseFloat(v.fee)).toFixed(2)}}</td>
				<td>{{v.remark}}</td>
			</tr>
		</tbody>
	</table>
	
</div>
<script>
	var vm=new Vue({
		el:"#main",
		data:{
			name:"lzp",
			list:<?php echo json_encode($this->params['list']);?>
		},
		computed:{
			all_income:function(){
				var a=0;
				for(var i in this.list)
				{
					a+=parseFloat(this.list[i]['in_come']);
				}
				return a;
			},
			clean_fee:function(){
				var a=0;
				for(var i in this.list)
				{
					var sum = (parseFloat(this.list[i].in_come)+parseFloat(this.list[i].total_fee)+parseFloat(this.list[i].fee)).toFixed(2);
					a += parseFloat(sum);
				}
				return a;
			}
		}
	})
</script>
<?php echo $this->render('/public/footer');?>